/*
 * @Description: 系统管理服务
 * @Version: 1.0
 * @Autor: jiajun wu
 * @Date: 2021-11-24 17:16:31
 * @LastEditors: jiajun wu
 * @LastEditTime: 2021-12-02 17:59:21
 */
import { ResDataStruct } from "@/interface/request";
import { LoginResStruct, LoginStruct } from "@/interface/user";
import axios from "@/utils/request";
import { AxiosPromise } from "axios";

/**
 *  验证是否已登陆
 */
export function isAuthed(): AxiosPromise<ResDataStruct<LoginResStruct>> {
  return axios({
    url: '/login-server/isAuthed',
    method: "post"
  })
}

/** 登录 */
export function login(data: LoginStruct): AxiosPromise<ResDataStruct<LoginResStruct>> {
  return axios({
    url: '/login-server/login',
    method: "post",
    data
  })
}
